Automated O M: flask-bootstrap + highstock integration and highstock
1,
Load highstock. js in the base.html template of flask-bootstrap.The following is an example of calling a js file in the source code of base.html. File Path: python2.7/site-packages/flask_bootstrap/templates/bootstrap/base.html {% block scripts %} however, if you use the preceding format,
Highstock's data format uses [[Time, Data],[time, data],[time, data],[time, data]], and time uses 13-bit millisecond values, such as [1133136000000,69.66], The time format used is UTC (World standard Time), so in the background to the time
Highcharts is a JS drawing component that is relatively mature and compatible in the industry.
Its implementation is based on native Js. It adopts VML implementation in IE and SVG implementation in other browsers. The most important thing is that
Provide complete Highcharts resource package, including instance file, all JS compressed version and source code, export server file, etc.1, the use of resource bundles:2. Open cdn:http://img.hcharts.cn/Second, the installation of Highchart:1. Install with NPM:NPM Related documents: http://www.npmjs.com.cn/--save
Load Highcharts
Require (' highcharts '); //Load function module require (' highcharts/modules/exporting ') (highcharts) after highcharts load; //Create Chart Highc
page displayAccept data submitted by POSTJson data GET InterfaceThe framework structure is as follows:
The directory structure is as follows:
web├── flask_web.py└── templates └── mon.html
The flask_web code is as follows:
import MySQLdb as mysqlimport jsonfrom flask import Flask, request, render_templateapp = Flask(__name__)db = mysql.connect(user="361way", passwd="123456", \ db="falcon", charset="utf8")db.autocommit(True)c = db.cursor()@app.route("/", methods=["GET", "POST"])def hello():
Charts-chart plug-in
1) highstock Allows you to create stock or general timeline charts using pure JavaScript. Home: http://www.highcharts.com/products/highstock
2) smoothie charts Is a script for generating small charts. It is designed to generate real-time data charts. For example, a chart can be used to generate CPU usage.
Home page: http://smoothiecharts.org/demo address: http://smoothiecharts.o
page displayAccept data submitted by POSTJson data GET interfaceThe framework structure is as follows:
The directory structure is as follows:
web├── flask_web.py└── templates └── mon.html
The flask_web code is as follows:
import MySQLdb as mysqlimport jsonfrom flask import Flask, request, render_templateapp = Flask(__name__)db = mysql.connect(user="361way", passwd="123456", \ db="falcon", charset="utf8")db.autocommit(True)c = db.cursor()@app.route("/", methods=["GET", "POST"])def hello(
How to Use the Highcharts chart plug-inThe Highcharts chart control is currently the most widely used chart control. This article will gradually introduce you to the Highcharts chart control from scratch. In this article, you will learn how to configure Highcharts and dynamically generate Highchart charts.
Highcharts is a very popular pure Javascript chart library with beautiful UI. It consists of two parts: Highcharts and Highstock. Highcharts provid
When we do a variety of applications, we may use to chart statistics, previously exposed to a number of different chart controls, inadvertently discovered the chart control Highcharts, its powerful features and rich interactive effect, unforgettable. This article mainly introduces the use of chart control highcharts in Web development, as well as the unification of Chinese and other operations, so that our program functions richer, more beautiful content.1, Highcharts Basic IntroductionHighchart
When we do a variety of applications, we may use to chart statistics, previously exposed to a number of different chart controls, inadvertently discovered the chart control Highcharts, its powerful features and rich interactive effect, unforgettable. This article mainly introduces the use of chart control highcharts in Web development, as well as the unification of Chinese and other operations, so that our program functions richer, more beautiful content.1, Highcharts Basic IntroductionHighchart
' Time ', ' mem_usage ' from ' stat '") ones = [[i[0]*1000, i[1]] for i in C.fetchall ()] Retur N "%s" (%s); "% (Request.args.get (' callback '), json.dumps (ones)) if __name__ = =" __main__ ": App.run (host=" 0.0.0.0 ", port= 8888,Debug=true)
Here the use of the map JS for Highcharts, Highstock, the specific template page content is as follows:
[Root@91it templates]# Cat mon.html
Memory Monitor
)) if __name__ = = "__main__": App.run (host= "0.0.0.0", port=8888, Debug=true)
This template page is an example of the Highstock I copied, mon.html
For the sake of simplicity, we only show mem_usage information on the page.
Jb51.net
Highstock Example
The Web presentation page is complete and running:
Python flask_web.py listening on port 8888
We need to make an agent to c
page displayAccept data submitted by POSTJson data GET interfaceThe framework structure is as follows:
The directory structure is as follows:
web├── flask_web.py└── templates └── mon.html
The flask_web code is as follows:
import MySQLdb as mysqlimport jsonfrom flask import Flask, request, render_templateapp = Flask(__name__)db = mysql.connect(user="361way", passwd="123456", \ db="falcon", charset="utf8")db.autocommit(True)c = db.cursor()@app.route("/", methods=["GET", "POST"])def hello(
://developers.google.com/chart/No need to introduce more, we all know very well the visualization tool11, Highcharts650) this.width=650; "alt=" Jive Circle Case Study "class=" Img-thumbnail "src=" http://image.evget.com/images/article/2015/ Keshihua11.png "/>Links:http://www.highcharts.com/Highcharts is an aesthetically pleasing, very popular, pure Javascript Chart library. It actually consists of two parts: Highcharts and Highstock. Highcharts can ea
content:
The above is a real-time outdoor temperature statistics chart. The data is taken from mysql and the database adds a new record every five minutes. Now I want to display it through the highcharts chart. The problem I encountered is:
1) now the horizontal axis needs to be fixed, and the horizontal axis is 24 hours2) because the database format is 03:00:00, how can we display the time in the corresponding time area of the horizontal axis?That is to say, the database has a record. The dat
The highcharts chart control is currently the most widely used chart control. This article will gradually introduce you to the highcharts chart control from scratch. In this article, you will learn how to configure highcharts and dynamically generate highchart charts.
Highcharts is a very popular pure JavaScript chart library with beautiful UI. It consists of two parts: highcharts and highstock. Highcharts provides intuitive and interactive charts fo
Basic Introduction:
Highcharts is a very popular pure JavaScript chart library with beautiful UI. It consists of two parts: highcharts and highstock. Highcharts provides intuitive and interactive charts for your website or web applications. Currently, line, spline, area, areaspline, bar chart, bar chart, pie chart, and scatter chart types are supported. Highstock allows you to easily create stock or general
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.